<template>
  <div class="page-login">
    <div class="page-body">
      <div class="login-banner">
        <div class="test-1">好房京选 业务管理系统</div>
        <div class="test-2">JDLink Business System</div>

        <div class="banner-footer">
          <div>当前版本：0.0.1 <span @click="checkUpdate">检查更新</span></div>
          <div>Copyright 2021 好房京选 ® ALL Rights Reserved | 由 “天宇网络” 提供技术支持</div>
        </div>
      </div>
      <div class="login-container">
        <div class="win-close" @click="closeWindow" >
          <img src="/default/icon/icon_close_2.png" />
        </div>
        <div class="login-wrapper">
          <div class="login-header">
            <div class="header-logo">
              <img src="/default/logo/icon_logo.png" />
            </div>
            <div class="header-slogan">
              好房京选·经纪人业务管理系统
            </div>
          </div>
          <div class="login-body">
            <a-tabs default-active-key="1">
              <a-tab-pane key="1" tab="账号登录">
                <LoginForm />
              </a-tab-pane>
              <a-tab-pane key="2" tab="扫码登录" force-render>
                <LoginScan />
              </a-tab-pane>
            </a-tabs>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import LoginForm from '../components/LoginForm'
import LoginScan from '../components/LoginScan'
import render from '@/render'

export default {
  data () {
    return {
    }
  },
  components: {
    LoginForm,
    LoginScan
  },
  methods: {
    checkUpdate () {
      render.updateView()
    },
    closeWindow () {
      render.closeLoginWin()
    }
  }
}
</script>

<style lang="less" scoped>
.page-login{
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  position: fixed;
  .page-body{
    -webkit-app-region: drag;
    display: flex;
    position: absolute;
    left: 0px;
    top: 0px;
    right: 0px;
    bottom: 0px;
    background-color: #eee;
    box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.2);
    -webkit-user-select: none;
    .login-banner{
      flex: 1;
      background-image: url('/default/images/login_bg.png');
      background-repeat: no-repeat;
      background-size: cover;
      background-position: center;
      padding: 50px;
      .test-1{
        margin-top: 40px;
        font-size: 38px;
        color: #fff;
      }
      .test-2{
        margin-top: 10px;
        font-size: 18px;
        color: #fff;
      }
      .banner-footer{
        position: absolute;
        left: 40px;
        bottom: 20px;
        color: rgba(255, 255, 255, 0.7);
        span{
          cursor: pointer;
          -webkit-app-region: no-drag;
          &:hover{
            text-decoration: underline;
          }
        }
      }
    }
    .login-container{
      background-color: #fff;
      width: 300px;
      padding: 40px;
      .win-close {
        -webkit-app-region: no-drag;
        position: absolute;
        right: 12px;
        top: 12px;
        width: 26px;
        cursor: pointer;
        img {
          width: 100%;
          opacity: 0.3;
          transition: 0.3s all;
        }
        &:hover {
          img {
            transform: rotate(180deg);
          }
        }
      }
      .login-wrapper{
        -webkit-app-region: no-drag;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        .login-header{
          display: flex;
          flex-direction: column;
          align-items: center;
          justify-content: center;
          margin-top: 20px;
          .header-logo{
            img{
              width: 160px;
            }
          }
          .header-slogan{
            margin-top: 10px;
          }
        }
        .login-body{
          margin-top: 20px;
        }
      }
    }
  }
}
</style>
